import platform
import logging

logger = logging.getLogger(__name__)

def get_osdep_mixin():
	"""
	Returns the platform dependent code for the current platform.
	The loaded class has to implement the following functions:
		- _paste_text(): pastes text into textfield; optional may be lambda: None
		- set_taskbar_text(text): updates taskbar with given text
		- register_hotkey(): registers hotkey specified in config file
		- unregister_hotkey: unregisters hotkey, called on close
	"""
	sys = platform.system()
	if sys == "Windows":
		from osdep.win.wincode import PlatformSpecificCode
		return PlatformSpecificCode
	elif sys == "Darwin": # mac os x
		from osdep.mac.maccode import PlatformSpecificCode
		return PlatformSpecificCode
	else:
		logger.error("Could not load platform specific code. Platform identication: " + sys)
		sys.exit(1)
